Repository navigation
fix(cli): resolve tsconfig aliases in database seeds - #919
Merged
Merged
Conversation
# Conflicts: # packages/void/src/cli/db.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fall back to jiti when node:module has no registerHooks (Bun), resolve extensionless subpaths into packages without exports, load .tsx helpers, and skip .json files for path targets as TypeScript does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
App modules get named exports from JSON files and CommonJS modules, ESM-syntax JavaScript in a CommonJS app keeps require and __dirname, and extensionless absolute paths resolve as relative ones do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Running a CommonJS module inside the load hook changed evaluation order, could hit Node's require(esm) race guard, and changed what packages in node_modules received. CommonJS imports keep Node's export detection. JSON named exports now skip a byte order mark, __proto__, and malformed keys, and Windows drive paths get the extension fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A JSON file that app code imports uses the value require() caches, so both share one object, and every module in the seed graph gets the extension lookup jiti gave it. Aliases still apply only to app modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-db-seed-tsconfig-paths-void-cloud.voidzero-docs.workers.dev (commit 81a4e33)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
void db seednow resolves the path aliases in the app'stsconfig.json(such as@schemaand@auth-schema) in seed files and schema modules, including dynamicimport(). Closes #872.This continues #873 by @karthickeyan-dev, which was closed with its branch deleted. Their commits are kept as they were.
How it works
A missing
.void/tsconfig.jsonstops the seed before the reset and says to runvoid prepare.Known limits
export { SomeType } from './types'withouttypefails to link. TypeScript'sisolatedModulesreports the same thing.Verification
packages/void/test/unit/db-seed.test.ts: 36 tests. Each case added after fix(cli): resolve tsconfig aliases in database seeds #873's last commit failed before its fix.vp check,vp run test(178/178 tasks).🤖 Generated with Claude Code